package cn.thornbird.orgsync.vo.request;

import cn.thornbird.orgsync.vo.record.SimpleUserRecord;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
public class SignUpRequest {

    @NotBlank(message = "用户名为必填项")
    @Pattern(regexp = SimpleUserRecord.USERNAME_REG_EXP, message = "用户名不符合规则")
    private String username;

    @NotBlank(message = "手机号码为必填项")
    @Pattern(regexp = SimpleUserRecord.MOBILE_REG_EXP, message = "手机号码不正确")
    private String mobile;

    @NotBlank(message = "验证码为必填项")
    @Pattern(regexp = SendVerificationCodeRequest.VERIFICATION_CODE_REG_EXP, message = "验证码不正确")
    private String verificationCode;

    @NotBlank(message = "密码为必填项")
    @Pattern(regexp = SimpleUserRecord.PASSWORD_REG_EXP, message = "密码不符合规则")
    private String password;

    @Pattern(regexp = "^yes$", message = "必须阅读并同意注册条款")
    private String agree;

}
